﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RoleContextMenu.ascx.cs" Inherits="DMS.Web.Common.Controls.RoleContextMenu" %>
<script language="javascript" type="text/javascript">
<!--
    function ShowContextMenu(ID, Name) {
        try {
            var EmnuDpt = document.getElementById("dvCMenu");
            EmnuDpt.Reset();

            EmnuDpt.MenuWidth = 130;
            EmnuDpt.MenuHeight = 28;

            if (ID == "") {
                EmnuDpt.AddMenu("新增角色", "/Resources/Images/icon_new.gif", "AddSub('" + ID + "');");
            }
            else {
                EmnuDpt.AddMenu("详细信息", "/Resources/Images/icon_detail.gif", "ShowDetail('" + ID + "');");
                EmnuDpt.AddMenu("编辑角色", "/Resources/Images/icon_modify.gif", "Modify('" + ID + "');");
                EmnuDpt.AddMenu("删除角色", "/Resources/Images/icon_delete.gif", "Delete('" + ID + "','" + Name + "');");
            }

            EmnuDpt.ShowMenu(event.clientX, event.clientY);
        }
        catch (ex)
			{ }
    }

    function ShowDetail(ID) {
        OpenRoleForm(null, "View", ID);
    }

    function Modify(ID) {
        OpenRoleForm(null, "Edit", ID);
    }

    function Delete(ID, Name) {
        var cmdCtrlID = "<%=lbtnDel.ClientID %>".replace(/_/g, "$");
        if (confirm("确认删除“" + Name + "”?")) {
            __doPostBack(cmdCtrlID, ID);
        }
    }

    function AddSub(pID) {
        OpenRoleForm(null, "New", pID);
    }
//-->
</script>
<div id="dvCMenu" class="commonMenu" />
<div id="dvCMD" style="display: none;">
    <asp:LinkButton ID="lbtnDel" runat="server" OnClick="lbtnDel_Click">删除</asp:LinkButton>
</div>
